pub struct LoginRequest {
    username: String,
    password: String,
}



struct User {
    username: String,
    password: String,
    avatar: String,
    uid: String,
}


struct LoginResponse {
    token: String,
}


trait AuthService {
    fn login(&self, req: &LoginRequest) -> Option<LoginResponse>;
}

pub struct SimpleAuthService;



impl AuthService for SimpleAuthService {
    fn login(&self, req: &LoginRequest) -> Option<LoginResponse> {
        if req.username == "admin" && req.password == "123456" {
            Some(LoginResponse {
                token: "fake-jwt-token".to_string(),
            })
        } else {
            None
        }
    }
}